import React, { Component } from 'react';
import {SCREEN_WIDTH} from '../../Action/rpc'
import {MyInfo} from '../../Action/auth'

export default class ToPower extends Component {
    // 构造
      constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            name:'',
            time:'',
            agentName:'',
            powerNum:''
        };
      }

    componentDidMount() {
        this.getMyInfo()
    }

    async getMyInfo(){
        await MyInfo()
            .then(res=>{
                this.setState({name:res.MEMBER_NAME})
                this.setState({time:res.CREATE_TIME})
                this.setState({agentName:res.AGENT_NAME})
            })
    }

    render() {
        const {name,time,agentName} = this.state
        return (
            <div className="containerNav toPower" style={{paddingTop:81,paddingBottom:30}}>
                <div style={{width:'8.75rem',height:'6.1rem',margin:'auto'}}>
                    <img src={require('../../Images/common/powerHeader.png')} alt=""/>
                </div>
                {/*<div className="tc f12" style={{marginTop:20}}>
                    授权编号:<span style={{fontWeight:'bold'}}>LB454746876878</span>
                </div>*/}
                <div className="tc colorPower" style={{marginTop:46.5,fontSize:12.5}}>
                    <span>兹授权:</span>
                    <span className="di borderBtBlack f12" style={{paddingLeft:10,paddingRight:10}}>{name}</span>
                    (先生/女士)
                </div>
                <div className="tc padding20 mt1 colorPower" style={{fontSize:12.5}}>
                    维魅力微电商平台中思慕品牌指定代理商
                </div>
                <div className="tc padding20 mt5 colorPower" style={{fontSize:12.5}}>
                    代理权限为:
                </div>
                <div className="tc mt1 colorPower" style={{fontWeight:'bold',fontSize:12.5}}>
                    <span>&lt;&nbsp;&nbsp;</span><span>{agentName?agentName:'维魅力'}</span><span>&nbsp;&nbsp;&gt;</span>
                </div>
                <div style={{marginLeft:33,fontSize:10}}>
                    <div className="padding30 colorPower" style={{marginTop:'2.2rem'}}>
                        代理期间享受我司指定代理品牌权益
                    </div>
                    <div className="padding30 colorPower">
                        同时必须遵守我公司各项制度。
                    </div>
                    <div className="padding30 colorPower">
                        代理时间:{time}
                    </div>
                </div>
                <div className='tc'>
                    <div className="padding30 f12 colorPower" style={{fontSize:9,marginTop:21}}>
                        备注:本授权以正本为有效文本、不得彩印、涂改、转让。
                    </div>
                    <div className="padding30 colorPower" style={{fontSize:7.5,marginTop:7.5}}>
                        上海合维信息科技发展有限公司享有本授权书的最终解释权
                    </div>
                </div>
                <div className="colorPower" style={{marginTop:23.5,fontSize:9,marginLeft:100}}>
                    授权单位:上海合维信息科技发展有限公司
                </div>
            </div>
        );
    }
}
